//
// shlib.h
// libprotea
// Tools Library for the Protea Project / Shared Library functionality
// Copyright (C) 2003, 2004, 2005 eXegeSys, Inc.
// Copyright (C) 2008 Bruce A. James
//
// This program is part of the Protea Project.
//
// The Protea Project is free software; you can redistribute it and/or modify it 
// under the terms of the GNU General Public License as published by the 
// Free Software Foundation, either version 3 of the License, or (at your 
// option) any later version.
//
// The Protea Project is distributed in the hope that it will be useful, but 
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
// for more details.
// 
// You should have received a copy of the GNU General Public License along 
// with this program.  If not, see <http://www.gnu.org/licenses/>.
// 
// Please send correspondence to:
// 
// theproteaproject@gmail.com
//

#ifndef __PROTEA_SHLIB_H__
#define __PROTEA_SHLIB_H__

#include "../OS_defines.h"

/*
	\file shlib.h
	\brief OS independent routines for using shared libraries
*/

class __EXPORT XCSharedLibrary : public XCBase {
public:
	XCSharedLibrary();
	~XCSharedLibrary();

	///	Opens a shared library and returns a handle to that library
	void Open( const char* lib_name, bool global_flag = false );

	///	Obtains the address of a procedure within a shared library
	void* GetLibAddress( const char* name );

	///	Close a shared library
	void Close();

protected:
	LIBRARY_HANDLE handle;
};

#endif

